package com.ming_za.odupdaterserver.core.config.type;

import java.util.function.BiConsumer;
import java.util.function.Function;

public class LongValue extends ValueType<Long>{
    public LongValue(String key, Function<String, String> getter, BiConsumer<String, String> setter) {
        super(key, getter, setter);
    }

    public LongValue(String key, Long defaultVale, Function<String, String> getter, BiConsumer<String, String> setter) {
        super(key, defaultVale, getter, setter);
    }

    @Override
    protected Long valueToObject(String value) {
        if (value == null){
            return null;
        }
        return Long.parseLong(value);
    }

    @Override
    protected String objectToValue(Long value) {
        if (value == null){
            return null;
        }
        return value.toString();
    }
}
